﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/view.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Import Namespace="Workflow.Resource" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script>
    function saveHoliday() {
            $('#form').form('submit', {
                url: '/Holiday/SaveHoliday',
                success: function (data) {
                    eval('data=' + data);
                    if (data.Success) {
                        // _user_form.form('clear');
                        $.messager.alert('<%=Global.InfoTitle%>', data.Message, 'info', toBack);

                       // $.messager.alert('<%=Global.InfoTitle%>', data.Message, 'info');
                    } else {
                        $.messager.alert('<%=Global.ErrorTitle%>', data.Message, 'error', toBack);

                      //  $.messager.alert('<%=Global.ErrorTitle%>', data.Message, 'error');
                    }
                    
                   // window.location = '/User/Index';
                },
                onSubmit: function () {
                    //if (_user_form.valid())
                   
                    return $('#form').form('validate');
                    // else
                    //    return false;
                }
            });
        }
        function toBack() {
            window.location = '/Holiday/HolidayView';
        }
        $(function () {

            $('#IdleDate').datebox({
                formatter: function (date) { return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate(); },
                parser: function (date) { return new Date(Date.parse(date.replace(/-/g, "/"))); }
            });
        });
        </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  <form id="form" method="post" action="/User/SaveUser/">
    <input type="hidden" id="Id"  name="Id" value="<%= ((Workflow.Model.TIdleDate)this.ViewData["entity"]).Id %>" />
    <div class="panel">
        <div class="panel-header">
            <%=Global.Information%></div>
        <div class="panel-body">
            <table style="background: #fafafa; text-align: center; width:100%;height:160px">
            
                <tr>
                    <td align="right" width="20%">
                        <%=Global.IdleDate%>:
                    </td>
                    <td align="right" width="5%">
                       &nbsp;
                    </td>
                    <td align="left" width="75%">
                        <input id="IdleDate" name="IdleDate" class="easyui-datebox" style="width: 120px" value="<%= ((Workflow.Model.TIdleDate)this.ViewData["entity"]).IdleDate.ToString("yyyy-MM-dd") %>">
                     </td>
                </tr>
                
               
                <tr>
                    <td align="right">
                       
                    </td><td align="right" >
                       &nbsp;
                    </td>
                    <td align="left">
                       
        <a href="##" onclick="saveHoliday()" class="easyui-linkbutton" id="btn-save" icon="icon-save">
            <%=Global.save%></a> <a href="##" onclick="toBack()" class="easyui-linkbutton" id="btn-cancel"
                icon="icon-undo"><%=Global.back%></a>
  
                    </td>
                </tr>
                 
            </table>
        </div>
    </div>
    
    </form>
</asp:Content>
